/**
 * 
 */
package com.scpii.universal.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.BindContentAttributeTab;
import com.scpii.universal.hibernate.intface.BaseInterface;

/**
 * UniversalApi
 * 
 * @author 甘建新 2012-8-7下午01:33:52
 */
public class BindContentAttributeTabService implements
		BaseInterface<BindContentAttributeTab> {
	BaseDao<BindContentAttributeTab> bindContentAttributeDao;

	public BindContentAttributeTab get(Integer id) throws Exception {
		return bindContentAttributeDao.get(id);
	}

	public List<BindContentAttributeTab> getAll() throws Exception {
		return bindContentAttributeDao.getAll();
	}

	public BindContentAttributeTab get(String propertyName, Object value)
			throws Exception {
		return bindContentAttributeDao.get(propertyName, value);
	}

	public List<BindContentAttributeTab> getList(String propertyName,
			Object value) throws Exception {
		return bindContentAttributeDao.getList(propertyName, value);
	}

	public Long getTotalCount() throws Exception {
		return bindContentAttributeDao.getTotalCount();
	}

	public void save(BindContentAttributeTab obj) throws Exception {
		bindContentAttributeDao.save(obj);
	}

	public void update(BindContentAttributeTab obj) throws Exception {
		bindContentAttributeDao.update(obj);
	}

	public void delete(BindContentAttributeTab obj) throws Exception {
		bindContentAttributeDao.delete(obj);
	}

	public void delete(Integer id) throws Exception {
		bindContentAttributeDao.delete(id);
	}

	public List<BindContentAttributeTab> hqlGetList(String hql,
			Map<String, Object> argsMap) throws Exception {
		return bindContentAttributeDao.hqlGetList(hql, argsMap);
	}

	public void hqlUpdate(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		bindContentAttributeDao.hqlUpdate(namedHqlQuery, argsMap);
	}

	public Long hqlGetNums(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		return bindContentAttributeDao.hqlGetNums(namedHqlQuery, argsMap);
	}

	public List<BindContentAttributeTab> sqlGetList(String sqls,
			Map<String, Object> argsMap) throws Exception {
		return bindContentAttributeDao.sqlGetList(sqls, argsMap);
	}

	public void sqlUpdate(String sqls, Map<String, Object> argsMap)
			throws Exception {
		bindContentAttributeDao.sqlUpdate(sqls, argsMap);
	}

	public Long sqlGetNum(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return bindContentAttributeDao.sqlGetNum(sqls, argsMap);
	}
	
	/**
	 * 返回和内容绑定的属性
	 * @param viewContentId
	 * @return
	 * @throws Exception
	 * @author 甘建新
	 * 2012-8-7下午04:41:57
	 */
	public List<BindContentAttributeTab> getBindContentAttributeList(int viewContentId)throws Exception{
		if (viewContentId>0) {
			Map<String, Object> argsMap = new HashMap<String, Object>();
			argsMap.put("viewContentId", viewContentId);
			List<BindContentAttributeTab> bindContentAttributeList = this.hqlGetList("GET_ATTRIBUTELIST_BY_VIEW_CONTENTID", argsMap);
			return bindContentAttributeList;
		}
		return null;
	}

	// Setter
	public void setBindContentAttributeDao(
			BaseDao<BindContentAttributeTab> bindContentAttributeDao) {
		this.bindContentAttributeDao = bindContentAttributeDao;
	}

}
